package com.lyf.boot.modules.system.entity.dto;

import com.lyf.boot.validate.group.AddGroup;
import com.lyf.boot.validate.group.EditGroup;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import java.io.Serial;
import java.io.Serializable;

/**
 * 字典类型
 * @author Luyufan
 * @date 2023/8/16 10:58
 */
@Data
public class SysDictTypeDto implements Serializable {

    @Serial
    private static final long serialVersionUID = 5192954132021666403L;

    /**
     * 字典类型id
     */
    @NotNull(message = "字典类型id不能为空",groups = {EditGroup.class})
    private Long dictId;

    /**
     * 字典类型
     */
    @NotBlank(message = "字典类型不能为空",groups = {AddGroup.class, EditGroup.class})
    private String dictKey;

    /**
     * 类型名称
     */
    @NotBlank(message = "类型名称不能为空",groups = {AddGroup.class, EditGroup.class})
    private String dictValue;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 状态 状态： 0禁用 1启用
     */
    @NotNull(message = "状态不能为空",groups = {AddGroup.class, EditGroup.class})
    @Range(min = 0, max = 1, message = "状态取值不正确")
    private Integer status;
}
